<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>kisebo: Código-Fonte de F:/Projetos/Rodrigo/kisebo/src/modulos/TesteCasoUso3.cpp</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Gerado por Doxygen 1.5.7.1 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Página&nbsp;Principal</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Arquivos</span></a></li>
      <li><a href="dirs.html"><span>Diretórios</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Lista&nbsp;de&nbsp;Arquivos</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_e5fb231306b426dbf7288f735af63cb9.html">src</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_83ca731e651da59f6a36d635c8d92efa.html">modulos</a>
  </div>
</div>
<div class="contents">
<h1>TesteCasoUso3.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include "../kisebo/Livro.h"</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include "../kisebo/CarrinhoCompra.h"</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "../kisebo/Controlador.h"</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="keyword">using namespace </span>std;
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) {
<a name="l00010"></a>00010         <a class="code" href="class_livro.html" title="Classe para controle dos livros.   Principal elemento do sistema.">Livro</a> l;
<a name="l00011"></a>00011         CarrinhoCompra cc;
<a name="l00012"></a>00012         <a class="code" href="class_controlador.html" title="Classe que armazena os dados principais. Essa classe armazena os métodos de controle...">Controlador</a> *sistema = <span class="keyword">new</span> <a class="code" href="class_controlador.html" title="Classe que armazena os dados principais. Essa classe armazena os métodos de controle...">Controlador</a>();
<a name="l00013"></a>00013         <span class="keywordtype">long</span> ids[] =  { 1, 5, 20, 50};
<a name="l00014"></a>00014         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 4; i++)
<a name="l00015"></a>00015         {
<a name="l00016"></a>00016                 <span class="keywordtype">long</span> <span class="keywordtype">id</span> = ids[i];
<a name="l00017"></a>00017                 l = sistema-&gt;<a class="code" href="class_controlador.html#2f7e6b7f4456f8fc65c4e3caafa854ee">SelecionaLivro</a>(<span class="keywordtype">id</span>);
<a name="l00018"></a>00018                 <span class="comment">// cout &lt;&lt; endl &lt;&lt; l;</span>
<a name="l00019"></a>00019                 cc.Adiciona(l); 
<a name="l00020"></a>00020         }
<a name="l00021"></a>00021         sistema-&gt;<a class="code" href="class_controlador.html#4fd4e16c89c73f3002a7461becf5a6e2">AtualizaLivrosVendidos</a>(cc);
<a name="l00022"></a>00022         sistema-&gt;<a class="code" href="class_controlador.html#a3f135c02443da16c66a7346ee0f7a10">RegistraVenda</a>(cc);
<a name="l00023"></a>00023         <span class="keywordflow">return</span> 0;
<a name="l00024"></a>00024 }
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Gerado em Wed Dec 3 04:35:41 2008 para kisebo por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.7.1 </small></address>
</body>
</html>
